#include "query_result.h"
#include "../pdb_index/xyz.h"
#include "../bulk_storage/bulk_storage.h"
#include <string.h>


void query_result(int q_serial,struct xyz q_xyz,double q_distance,int h_serial, struct xyz h_xyz,char h_pdbcode[4]) {
  struct q_result * qr;
  struct store * qr_store = store_open_cached("qr_store","qr_store.fat",
                                             sizeof(struct qr),(off_t)100,(off_t)2000);
  int i = store_new(qr_store);
  qr->q_serial = q_serial;
  //qr->q_xyz = q_xyz;
  memcpy(&(qr->q_xyz),q_xyz,sizeof(struct xyz));
  qr->q_distance = q_distance;
  qr->h_serial = h_serial;
  //qr->h_xyz = h_xyz;
  memcpy(&(qr->h_xyz),h_xyz,sizeof(struct xyz));
  qr->h_pdbcode = h_pdbcode;
  
  store_write(qr_store, i);
  store_release(qr_store,i);
}
